Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sound routing and convert tegra gpio #127

Merged
merged 4 commits into from
Aug 15, 2022
Merged

Update sound routing and convert tegra gpio #127

merged 4 commits into from
Aug 15, 2022

Conversation

clamor-s
Copy link
Contributor

@clamor-s clamor-s commented Aug 5, 2022

  • gpio-tegra driver needs a review, if remove of tegra_gpio_irq_set_affinity does not brake anything;
  • sound was reworked but it misses key part, headset detection. Asus made dumb stuff, Transformers have hp detect, not headset.
    PW2 = low PX2 = low --- default
    PW2 = high PX2 = low --- headset
    PW2 = high PX2 = high --- headphones
    tegra_asoc_machine needs a workarround :( it may work for grouper as well btw.

@clamor-s clamor-s requested a review from digetx August 5, 2022 15:56
drivers/gpio/gpio-tegra.c Outdated Show resolved Hide resolved
drivers/gpio/gpio-tegra.c Outdated Show resolved Hide resolved
drivers/gpio/gpio-tegra.c Outdated Show resolved Hide resolved
@clamor-s
Copy link
Contributor Author

clamor-s commented Aug 7, 2022

[SQUASH] ASoC: tegra: Support RT5631 by machine driver 930e9a4 -- includes mic jack detection fix

I can squash all dts changes for transformers into one commit, that may be a correct solution.

gpio: tegra: Convert to immutable irq chip b4b8658 -- fixed

@clamor-s
Copy link
Contributor Author

clamor-s commented Aug 7, 2022

I have squashed dts changes into one commit. There are also small patches into dsp (set it tristate) and asusec-kbc (change camera key to print key). I will amend those once/if this patch is approved.

tegra_machine_mic_jack_gpio.desc = machine->gpiod_mic_det;

if (machine->bound_mic_jack)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This machine->bound_mic_jack is unnecessary, use of_property_read_bool directly.

The nvidia,bound-mic-jack doesn't sound good to me, it doesn't explain what is bounded. Something like nvidia,bounded-mic-hp-det or nvidia,coupled-mic-hp-det should be better, IMO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also need to update the DT binding.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@digetx updated

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll need to document the new nvidia,coupled-mic-hp-det property in the DT binding.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will refit and incorporate those patches. Are you ok with that?

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
…E TF300TL

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
- fix headset detection in common device tree;
- diverge control and detect elements for mic;
- use GPIO mic detection on wm8903 devices;

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Update the driver to use an immutable IRQ chip to fix this warning:

    "not an immutable chip, please consider fixing it!"

Preserve per-chip labels by adding an ->irq_print_chip() callback.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
@digetx
Copy link
Member

digetx commented Aug 15, 2022

Thanks

@digetx digetx merged commit 701ab7e into grate-driver:master Aug 15, 2022
okias pushed a commit to okias/linux that referenced this pull request Jan 7, 2024
[ Upstream commit c0e8246 ]

memset() description in ISO/IEC 9899:1999 (and elsewhere) says:

	The memset function copies the value of c (converted to an
	unsigned char) into each of the first n characters of the
	object pointed to by s.

The kernel's arm32 memset does not cast c to unsigned char. This results
in the following code to produce erroneous output:

	char a[128];
	memset(a, -128, sizeof(a));

This is because gcc will generally emit the following code before
it calls memset() :

	mov   r0, r7
	mvn   r1, grate-driver#127        ; 0x7f
	bl    00000000 <memset>

r1 ends up with 0xffffff80 before being used by memset() and the
'a' array will have -128 once in every four bytes while the other
bytes will be set incorrectly to -1 like this (printing the first
8 bytes) :

	test_module: -128 -1 -1 -1
	test_module: -1 -1 -1 -128

The change here is to 'and' r1 with 255 before it is used.

Fixes: 1da177e ("Linux-2.6.12-rc2")
Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Kursad Oney <kursad.oney@broadcom.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
okias pushed a commit to okias/linux that referenced this pull request Jan 11, 2024
Like commit 1cf3bfc ("bpf: Support 64-bit pointers to kfuncs")
for s390x, add support for 64-bit pointers to kfuncs for LoongArch.
Since the infrastructure is already implemented in BPF core, the only
thing need to be done is to override bpf_jit_supports_far_kfunc_call().

Before this change, several test_verifier tests failed:

  # ./test_verifier | grep # | grep FAIL
  grate-driver#119/p calls: invalid kfunc call: ptr_to_mem to struct with non-scalar FAIL
  grate-driver#120/p calls: invalid kfunc call: ptr_to_mem to struct with nesting depth > 4 FAIL
  grate-driver#121/p calls: invalid kfunc call: ptr_to_mem to struct with FAM FAIL
  grate-driver#122/p calls: invalid kfunc call: reg->type != PTR_TO_CTX FAIL
  grate-driver#123/p calls: invalid kfunc call: void * not allowed in func proto without mem size arg FAIL
  grate-driver#124/p calls: trigger reg2btf_ids[reg->type] for reg->type > __BPF_REG_TYPE_MAX FAIL
  grate-driver#125/p calls: invalid kfunc call: reg->off must be zero when passed to release kfunc FAIL
  grate-driver#126/p calls: invalid kfunc call: don't match first member type when passed to release kfunc FAIL
  grate-driver#127/p calls: invalid kfunc call: PTR_TO_BTF_ID with negative offset FAIL
  grate-driver#128/p calls: invalid kfunc call: PTR_TO_BTF_ID with variable offset FAIL
  grate-driver#129/p calls: invalid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  grate-driver#130/p calls: valid kfunc call: referenced arg needs refcounted PTR_TO_BTF_ID FAIL
  #486/p map_kptr: ref: reference state created and released on xchg FAIL

This is because the kfuncs in the loaded module are far away from
__bpf_call_base:

  ffff800002009440 t bpf_kfunc_call_test_fail1    [bpf_testmod]
  9000000002e128d8 T __bpf_call_base

The offset relative to __bpf_call_base does NOT fit in s32, which breaks
the assumption in BPF core. Enable bpf_jit_supports_far_kfunc_call() lifts
this limit.

Note that to reproduce the above result, tools/testing/selftests/bpf/config
should be applied, and run the test with JIT enabled, unpriv BPF enabled.

With this change, the test_verifier tests now all passed:

  # ./test_verifier
  ...
  Summary: 777 PASSED, 0 SKIPPED, 0 FAILED

Tested-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Hengqi Chen <hengqi.chen@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants